<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<?php echo $this->Html->charset(); ?>
	<title>
		<?php __('Authentic Avenue :: Site Logs'); ?>		
	</title>	
	<link rel="shortcut icon" href="<?php echo $this->webroot; ?>img/favicon.ico" type="image/x-icon" />

</head>
<body>
<h1>Site Logs</h1>
<?php $SiteLogs=explode("\n",$this->data['SiteLog']);?>
<div id="">
<div id="overlay">
Please wait...
</div>
<table id="sitelog_table" cellspacing="0" class="tablesorter">
<thead>
<tr><th>Date and Time</th><th>User</th><th>IP</th><th>Visited LInk</th></tr>
</thead>
<tbody>
<?php
$i = 0;

	foreach($SiteLogs as $SiteLog):
	
		if($SiteLog):
			$data=explode(" ",$SiteLog);						
			$class = ' class="odd"';
			if ($i++ % 2 == 0)
				$class = ' class="even"';
			echo"<tr ".$class."><td>".$data[0]." ".$data[1]."</td><td>".$data[4]."</td><td>".$data[7]."</td><td>".$data[9]."</td></tr>";
			
		endif;
	endforeach;
?>
</tbody>
</table>
<div id="pager" class="pager">
	<form>
		<?php echo $this->Html->image('first.png', array("class"=>"first",'alt' => 'First'));?>
		<?php echo $this->Html->image('prev.png', array("class"=>"prev",'alt' => 'Prev'));?>		
		<input type="text" class="pagedisplay"/>
		<?php echo $this->Html->image('next.png', array("class"=>"next",'alt' => 'Next'));?>
		<?php echo $this->Html->image('last.png', array("class"=>"last",'alt' => 'Last'));?>		
		<select class="pagesize">
			<option selected="selected"  value="1000">1000</option>
			<option value="2000">2000</option>
			<option value="3000">3000</option>
			<option  value="4000">4000</option>
			<option  value="5000">5000</option>
			
		</select>
	</form>
</div>
</div>
<?php		
	echo $this->Html->css('table_css');
?>
<?php  echo $html->script(array("jquery.min.js","jquery.tablesorter.pager.js","jquery.tablesorter.min.js","jquery.tablednd.js")); ?>	 
<script type="text/javascript"> 
jQuery.noConflict();
 jQuery(document).ready(function(){
	jQuery("#sitelog_table").tablesorter({sortList: [[0,1]]})
							.tablesorterPager({container: jQuery("#pager")});
	jQuery("#sitelog_table").bind("sortStart",function() {
		jQuery("#overlay").show();
	}).bind("sortEnd",function() {
		jQuery("#overlay").hide();
	});
	
 });	
</script>
</body>
</html>